
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.Scanner; 
 
/**
 * Class t - write a description of the class here
 * 
 * @author (your name) 
 * @version (a version number)
 */
public class AdvancedStartedCode extends BorlandBase
{
    BTextField textField1=new BTextField(29);
    JButton button1= new JButton ("Test Button");
    
    int x;
    
    public void initialize()
    {
        //setWidth(300);
        setFullScreen();
        setAnimation(true);
        setBackgroundColor(Color.blue);
        //setBackgroundImage("i.jpg");
        addItem(textField1);
        addItem(button1);
    }

    public void buttonPressed (Component c)
    {
        if (c==button1)
        {
            echo("button pressed");
        }
    }

    public void keyPressed(KeyEvent e)
    {
        int code=e.getKeyCode();
        char key=e.getKeyChar();
    }

    public void paintScreen (Graphics g)
    {             
    }

    //the method below will get called every frame.
    //its argument g is the temporary graphics layer
    public void update(Graphics g)
    {        
        x++; 
		g.setColor(Color.green); 
        g.fillRect(40+x,50,20,20);               
    }

public static void runAsApplet()
    {
        try{  BorlandBase.runAsApplet((BorlandBase)(new Object() { }.getClass().getEnclosingClass().newInstance()));  }
        catch (Exception e){e.printStackTrace();}
    }

    public static void main(String[] args) {
        try{  BorlandBase.main((BorlandBase)(new Object() { }.getClass().getEnclosingClass().newInstance()));  }
        catch (Exception e){e.printStackTrace();}
    }
    

}
